#!/usr/bin/python
# -*- coding: UTF-8 -*-
import string

def tdli2_head():
    strHead = r"""
<?xml version="1.0" encoding="UTF-8"?>
<report datalayout='csdt690001.xml' pagesize='60' columnsize='120'>
    <head>
        <space>50</space>
        <data>
            <variable>BANK_NAME</variable>
            <justify>Left</justify>
            <length>40</length>
        </data>
        <label>打印日期: </label>
        <data>
            <variable>SYS_DATE</variable>
            <justify>Left</justify>
            <format type='date'>yyyy/mm/dd</format>
            <length>10</length>
        </data>
        <newline>1</newline>
        <label>打印用户: </label>
        <data>
            <variable>USER_ID</variable>
            <justify>Left</justify>
            <length>20</length>
        </data>
        <space>18</space>
        <label>********</label>
        <space>30</space>
        <label>时间: </label>
        <data>
            <variable>SYS_TIME</variable>
            <justify>Left</justify>
            <length>8</length>
        </data>
        <newline>1</newline>
        <label>处理日: </label>
        <data>
            <variable>PROC_DATE</variable>
            <justify>Left</justify>
            <format type='date'>yyyy/mm/dd</format>
            <length>10</length>
        </data>
    </head>
    """
    
    return string.replace(strHead, '\t', ' '*4)

def tdli2_tail():
    strTail = r"""
    <totalsum>
        <label>总记录数:</label>
        <data>
            <variable>__TOTAL_COUNT__</variable>
            <justify>Right</justify>
            <length>6</length>
        </data>
        <space>10</space>
    </totalsum>
    <tail>
    </tail>
</report>
    """
    
    return strTail